package model.happy;

import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import model.admin.OptionalServiceVO;

public class HappyTimeService {
	private HappyTimeDao happyTimeDao;
	public HappyTimeService(HappyTimeDao happyTimeDao){
		this.happyTimeDao=happyTimeDao;
	}
	
	public ListVO happytime(String pageNo) throws SQLException {
		if(pageNo==null||pageNo.equals("")){
			pageNo="1";
		}
		List list=happyTimeDao.happytime(pageNo);
		int totalContent=happyTimeDao.getTotalContent();
		ListVO listVO=new ListVO(list,new PagingBean(totalContent, Integer.parseInt(pageNo)));
		return listVO;
	}

	public OptionalServiceVO intoAlbum(OptionalServiceVO osvo) throws SQLException {
		return happyTimeDao.intoAlbum(osvo);
	}

	public HashMap coupleFindById(String id) throws SQLException {
		return happyTimeDao.coupleFindById(id);
	}

	public List showHappyMoney() throws SQLException {
		return happyTimeDao.showHappyMoney();
	}
}
